import QtQuick 2.0
import QtQuick.Dialogs 1.0
import QtQuick.Controls 1.0
Rectangle {
    width: 580
    height: 400
    color: palette.window
    SystemPalette { id: palette }
    clip: true
    //! [filedialog]
    FileDialog {
        id: fileDialog
    }
    //! [filedialog]
    Rectangle{
        id:rec
        anchors.left: parent.left
        anchors.right: parent.right
        anchors.top:parent.top
        height: 33
        //border.color: Qt.darker(palette.window, 1.3)
        Row {
            spacing: 3
            anchors.left: parent.left
            anchors.bottom: parent.bottom
            Button {
                height: 30
                text: "Emulator"
                // onClicked: fileDialog.open()
            }
            Button {
                height: 30
                text: "Video"
                //anchors.verticalCenter: parent.verticalCenter
                //onClicked: fileDialog.close()
            }
            Button {
                height: 30
                text: "Input"
                //anchors.verticalCenter: parent.verticalCenter
                // TODO: QTBUG-29814 This isn't portable, but we don't expose QDir::tempPath to QML yet.
                //onClicked: fileDialog.folder = "/tmp" // file:///tmp would also be OK
            }
            Button {
                height: 30
                text: "Audio"
                anchors.verticalCenter: parent.verticalCenter
                //onClicked: fileDialog.close()
            }
            Button {
                height: 30
                text: "Extras"
                anchors.verticalCenter: parent.verticalCenter
                //onClicked: fileDialog.close()
            }
        }
    }
    Rectangle {
        id:rec1
        anchors.top:rec.bottom
        Column {
            anchors.left: parent.left
            anchors.leftMargin: 10
            anchors.top:parent.bottom
            anchors.topMargin:70
            width: 100
            Button {
                id:button1
                text: "Open"
                height:30
                onClicked: fileDialog.open()
            }
            Button {
                id:button2
                anchors.top:button1.bottom
                anchors.topMargin:20
                text: "Play Game!"
                height:30
                //onClicked: fileDialog.close()
            }
            Button {
                id:button3
                anchors.top:button2.bottom
                anchors.topMargin: 20
                text: "Cheats…"
                height:30
                Connections{
                    onClicked:cheatdialog.visible=true
                }


                // TODO: QTBUG-29814 This isn't portable, but we don't expose QDir::tempPath to QML yet.
                //onClicked: fileDialog.folder = "/tmp" // file:///tmp would also be OK
            }
        }
    }

    Rectangle{
        anchors.left: rec1.right
        anchors.bottom:parent.bottom
        anchors.right: parent.right
        anchors.rightMargin: 240
        Row {
            id:rec2
            spacing: 3
            anchors.bottom:parent.bottom
            anchors.bottomMargin: 20
            anchors.right: parent.right
            width: 100
            Button {
                text: "Stop"
                height:30
                // onClicked: fileDialog.open()
            }
            Button {
                text: "Play"
                height:30
                //onClicked: fileDialog.close()
            }
        }
    }
    CheatDialog{
        id:cheatdialog
        visible: false
    }
}


